package cn.xval.ft.app.gen.params;

import lombok.Data;
import io.swagger.v3.oas.annotations.media.Schema;
import com.fasterxml.jackson.annotation.JsonInclude;
import jakarta.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;

public class ProductParams {
    @Data
    @Schema(description = "Product新增请求参数")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public static class ProductCreateClassRequest {
        @NotNull
        @Schema(description = "名称")
        @Length(max = 20)
        private String name;
        @NotNull
        @Schema(description = "排序字段")
        private Integer orderNo;
    }
    @Data
    @Schema(description = "Product 返回数据")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public static class ProductInfo {
        @Schema(description = "编码")
        private String id;
        @Schema(description = "品种代码")
        private String code;
        @Schema(description = "名称")
        private String name;
        @Schema(description = "上级分类 id")
        private String parentId;
        @Schema(description = "排序字段")
        private Integer orderNo;
    }
    @Data
    @Schema(description = "Product新增请求参数")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public static class ProductCreateRequest {
        @NotNull
        @Schema(description = "名称")
        @Length(max = 20)
        private String name;
        @Schema(description = "上级分类 id")
        private String parentId;
        @Schema(description = "品种代码")
        @Length(max = 20)
        private String code;
        @NotNull
        @Schema(description = "排序字段")
        private Integer orderNo;
    }
    @Data
    @Schema(description = "Product删除请求参数")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public static class ProductRemoveRequest {
        @NotNull
        @Schema(description = "编码")
        private String id;
    }
    @Data
    @Schema(description = "Product更新请求参数")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public static class ProductModifyRequest {
        @NotNull
        @Schema(description = "编码")
        private String id;
        @NotNull
        @Schema(description = "名称")
        @Length(max = 20)
        private String name;
    }
}